package com.dtec.resource.settingInfo;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.UUID;

public class Contact {
	private String id = "";
	private String addTime = "";
	private String name = "";
	private String contactAddress = "";

	public String getAddTime() {
		if (addTime == null || "".equals(addTime)) {
			setAddTime(null);
		}
		return addTime;
	}

	public void setAddTime(String addTime) {
		if (addTime == null || "".equals(addTime)) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
			Date date = Calendar.getInstance().getTime();
			this.addTime = sdf.format(date);
		} else {
			this.addTime = addTime;
		}
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getContactAddress() {
		return contactAddress;
	}

	public void setContactAddress(String contactAddress) {
		this.contactAddress = contactAddress;
	}

	public String getId() {
		if (id == null || "".equals(id)) {
			setId(null);
		}
		return id;
	}

	public void setId(String id) {
		if (id == null || "".equals(id)) {
			this.id = UUID.randomUUID().toString();
		} else {
			this.id = id;
		}
	}
}
